package com.util.cdb.service.impl;

import com.util.cdb.service.ExcuteSqlService;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @description: 实现类
 * @author: fengfazheng
 * @create: 2021-12-26 17:13
 **/
@Service
public class ExcuteSqlServiceImpl implements ExcuteSqlService {
    private static String url ="jdbc:mysql://localhost:3306/mmall?serverTimezone=UTC&zeroDateTimeBehavior=convertToNull";
    /**
     *  返回 List<Map<String, Object>>
     * @param sql
     * @return
     * @throws SQLException
     */
    @Override
    public List<Map<String, Object>> excuteSelectSql(String sql) throws SQLException {
//        ConnectionParam connectionParam =new ConnectionParam("01",url,"root","root");
//        JdbcTemplate jdbcTemplate= HikariConfigUtil.getJdbcTemplate(connectionParam);
//        return  jdbcTemplate.queryForList(sql);
        return null;
    }

//    @Override
//    public List<Map<String, Object>> excuteSql(String sql) throws SQLException {
//        ConnectionParam connectionParam =new ConnectionParam("01",url,"root","root");
//        JdbcTemplate jdbcTemplate= HikariConfigUtil.getJdbcTemplate(connectionParam);
//        return jdbcTemplate.queryForList(sql);
//    }
}
